In this step, you'll create a UWP application in Visual Studio using TileListBox for UWP.
Complete the following steps:
Markup Copy Code <StackPanel x:Name="loading" VerticalAlignment="Center"> <TextBlock Text="Retrieving data from YouTube..." TextAlignment="Center"/> <ProgressBar IsIndeterminate="True" Width="200" Height="4"/> </StackPanel>
The TextBlock and ProgressBar will indicate that the C1TileListBox is loading.
Markup Copy Code <Xaml:C1TileListBox x:Name="tileListBox" ItemsSource="{Binding}" Background="Transparent" Visibility="Collapsed" ItemWidth="800" ItemHeight="600" RefreshWhileScrolling="False"></Xaml:C1TileListBox>
This gives the control a name and customizes the binding, background, visibility, size, and refreshing ability of the control.
Markup Copy Code <Xaml:C1TileListBox.PreviewItemTemplate> <DataTemplate> <Grid Background="Gray"/> </DataTemplate> </Xaml:C1TileListBox.PreviewItemTemplate> <Xaml:C1TileListBox.ItemTemplate> <DataTemplate> <Grid Background="LightBlue"> <Image Source="{Binding Thumbnail}" Stretch="UniformToFill"/> <TextBlock Text="{Binding Title}" Foreground="White" Margin="4 0 0 4" VerticalAlignment="Bottom"/> </Grid> </DataTemplate> </Xaml:C1TileListBox.ItemTemplate>
This markup adds data templates for the C1TileListBox control's content. Note that you'll complete binding the control in code.
What You've Accomplished
You've successfully created a UWP style application containing a C1TileListBox control. In the next step, Step 2 of 3: Adding Data to the TileListBox, you will add the data for C1TileListBox.